package com.hshx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hshx.dao.RecordDao;
import com.hshx.pojo.Record;
import com.hshx.pojo.Salary;
import com.hshx.service.RecordService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional
public class RecordServiceImpl extends ServiceImpl<RecordDao, Record> implements RecordService {


    @Resource
    private RecordDao recordDao;

    @Override
    public boolean addRecord(Record record) {
        return recordDao.addRecord(record)>0;
    }

    @Override
    public Page<Record> selAllRecord(int pageIndex, int pageSize) {
        Page<Record> page = PageHelper.startPage(pageIndex,pageSize);
        recordDao.selAllRecord();
        return page;
    }
}
